﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>TreeSelect 懒加载</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" /><link href="../demo.css" rel="stylesheet" type="text/css" />

    
    <script src="../../scripts/boot.js" type="text/javascript"></script>
    
    

</head>
<body>
    <h1>TreeSelect 懒加载</h1>      
    
    <input id="treeselect1" class="mini-treeselect" url="../data/TreeService.jsp?method=LoadNodes" 
        valueField="id" textField="name" multiSelect="true" 
        value="5,6" text="System,Video"
        />
    

    <br /><br />
    <input type="button" value="setValue" onclick="setValue()"/>
    <input type="button" value="getValue" onclick="getValue()"/>    
    <input type="button" value="disable" onclick="disable()"/>
    <input type="button" value="enable" onclick="enable()"/>
        
    <script type="text/javascript">
        function setValue() {
            var t = mini.get("treeselect1");
            
            //动态加载节点时，除setValue，也要setText
            t.setValue("5,6");
            t.setText("System,Video");
        }
        function getValue() {
            var t = mini.get("treeselect1");
            alert(t.getValue());
        }
        function enable() {
            var t = mini.get("treeselect1");
            t.enable();
        }
        function disable() {
            var t = mini.get("treeselect1");

            t.disable();
        }
        

    </script>

</body>
</html>